<?php

namespace app\adminapi\validate;

use app\common\validate\BaseValidate;

class SysDictTypeValidate extends BaseValidate
{
    protected $rule = [
        'pageNo' => 'regex:/^([1-9]\d*)$/',
        'pageSize' => ['regex'=>'/^(-1|[1-9]\d*)$/'],
        'dictId' => 'require|number',
        'dictName' => 'require',
        'dictCode' => 'require',
    ];

    protected $message = [
        'pageNo.regex' => '分页页码只能是数字',
        'pageSize.regex' => '分页页大小只能是数字',
        'dictId.require' => '字典类型参数不完整',
        'dictId.number' => '字典类型ID类型错误',
        'dictName.require' => '请输入字典类型名称',
        'dictCode.require' => '请输入字典类型编码',
    ];

    protected $scene = [
        'list' => ['pageNo', 'pageSize'],
        'insert' => ['dictName', 'dictCode'],
        'delete' => ['dictId'],
        'query' => ['dictId'],
        'update' => ['dictId', 'dictName', 'dictCode']
    ];
}